import React from "react";
// 1.引入
import story from "./story";
import { toggle as setToggle } from "./story/actionCreators";
const Index = () => {
  // 切换
  const data = story.getState();
  let toggLe = ({ target }) => {
    // 派发动作
    story.dispatch(setToggle(target.value));
  };
  return (
    <div>
      <select onChange={toggLe}>
        <option value="cn">中文</option>
        <option value="en">英文</option>
      </select>
      <h1>{data.title}</h1>
    </div>
  );
};

export default Index;
